import request from "@/sheep/request";

const LocationBreedApi = {
	// 获得用户的植物位置、品种列表
	getLocationBreedList: (uid:number) => {
	  return request({
	    url: '/huadada/location-breed/list',
	    method: 'GET',
		params: {uid}
	  });
	},
	//创建植物的 位置、品种
	addLocationBreed: (data) =>{
		console.log('addLocationBreed - data', data)
		return request({
			url: '/huadada/location-breed/create',
			method: 'POST',
			data,
			custom: {
			  showSuccess: true,
			  successMsg: '保存成功'
			},
		})
	},
	//更新植物的 位置、品种
	updateLocationBreed: (data) =>{
		console.log('addLocationBreed - data', data)
		return request({
			url: '/huadada/location-breed/update',
			method: 'PUT',
			data,
			custom: {
			  showSuccess: true,
			  successMsg: '保存成功'
			},
		})
	},
	
	// 获得位置、品种信息（所属用户）
	getLocationBreed: (id:number) => {
	  return request({
	    url: '/huadada/location-breed/get',
	    method: 'GET',
	    params: { id }
	  });
	},
	
	// 获得位置、品种信息（所属用户）
	deleteLocationBreed: (id:number) => {
	  return request({
	    url: '/huadada/location-breed/delete',
	    method: 'DELETE',
	    params: { id }
	  });
	},
}

export default LocationBreedApi;